home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F36018_strdropWhile.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-12-27  |  1.3 KB  |  38 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
  3. exclude-result-prefixes="xsl msxsl"
  4. >
  5.   <xsl:template name="str-dropWhile">
  6.     <xsl:param name="pStr" select="''"/>
  7.     <xsl:param name="pController" select="/.."/>
  8.     <xsl:param name="pContollerParam" select="/.."/>
  9.  
  10.     <xsl:if test="not($pController)">
  11.       <xsl:message terminate="yes">[str-dropWhile]Error: pController not specified.</xsl:message>
  12.     </xsl:if>   
  13.     
  14.       <xsl:if test="$pStr">
  15.         <xsl:variable name="vDrop">
  16.           <xsl:apply-templates select="$pController">
  17.             <xsl:with-param name="pChar" select="substring($pStr, 1, 1)"/>
  18.             <xsl:with-param name="pParams" select="$pContollerParam"/>
  19.           </xsl:apply-templates>
  20.         </xsl:variable>
  21.         
  22.         <xsl:choose>
  23.         <xsl:when test="string($vDrop)">
  24.            <xsl:call-template name="str-dropWhile">
  25.               <xsl:with-param name="pStr" select="substring($pStr, 2)" />
  26.               <xsl:with-param name="pController" select="$pController"/>
  27.               <xsl:with-param name="pContollerParam" select="$pContollerParam"/>
  28.            </xsl:call-template>
  29.         </xsl:when>
  30.         <xsl:otherwise>
  31.           <xsl:copy-of select="$pStr"/>
  32.         </xsl:otherwise>
  33.         </xsl:choose>
  34.       
  35.       </xsl:if>
  36.   </xsl:template>
  37.  
  38. </xsl:stylesheet>